package com.iurac.dao;

import com.iurac.domain.User;
import com.iurac.vo.UserVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserDao {

    User login(@Param("account") String account, @Param("password") String password, @Param("role") String role);

    String getBorrowCountById(@Param("id") String id);

    List<UserVo> getUsersByCondition(@Param("username") String username, @Param("account") String account,
                                     @Param("phone") String phone, @Param("sex") String[] sex, @Param("role") String[] role);

    Integer getNumOfUser();

    Integer getNumOfBorrowUserToday(@Param("today") String today);

    Integer getNumOfBorrowUser();

    Integer getNumOfBorrowUserTotal();


    int getBorrowCountByUid(@Param("uid") String uid);

    int deleteUserById(@Param("id") String id);

    int updateUser(User user);

    int getUserCountByAccount(@Param("account") String account);

    int saveUser(User user);

    int updatePhone(@Param("id") String id,@Param("phone") String phone);

    User getUserById(@Param("id") String id);

    int updatePassword(@Param("id") String id,@Param("password") String password);

    UserVo getUserByAccount(@Param("account") String account);

}
